// 初始化state
const initState = {
  posts: [
    { id: "c1", title: "标题一", content: "内容一" },
    { id: "c2", title: "标题二", content: "内容二" },
    { id: "c3", title: "标题三", content: "内容三" },
  ],
};


// 创建rootReducer函数，接受两个值，第一个值为状态(如果不初始化state，那么state的初始值为underfunded)，第二个值为状态，
const rootReducer= (state = initState, action: any) => {
  console.log(action);
  // reducer的作用就是返回新的状态值
  return state;
};

// 输出rootReducer组件
export default rootReducer;
